#ifndef AER_MATERIAL_HPP_
#define AER_MATERIAL_HPP_

#include "aerDefs.hpp"


namespace aer {

class Texture;//

class Material
{
  public:  
    struct PhongAttributes
    {
      Vector3 diffuse;
      Vector3 specular;
      float shininess;
    };
    
    struct BlendAttributes
    {
      float alpha;
    };    
  
  
  private:
    PhongAttributes m_phongAttribs;
    BlendAttributes m_blendAttribs;
    
    // Use an ID to a global ResourceManager instead
    Texture *m_pDiffuseMap;
    Texture *m_pSpecularMap;
    Texture *m_pNormalMap;
    
  
  public:
    Material()
      : m_pDiffuseMap(NULL),
        m_pSpecularMap(NULL),
        m_pNormalMap(NULL)
    {}
    
    
    // ===========
    // + Setters +
    // ===========
    void setPhongDiffuse(const Vector3& v) { m_phongAttribs.diffuse = v; }
    void setPhongSpecular(const Vector3& v) { m_phongAttribs.specular = v; }
    void setPhongShininess(float shininess) { m_phongAttribs.shininess = shininess; }
    
    void setBlendAlpha(float alpha) { m_blendAttribs.alpha = alpha; }
    
    void setDiffuseMap(Texture *pTexture)  { m_pDiffuseMap = pTexture; }
    void setSpecularMap(Texture *pTexture) { m_pSpecularMap = pTexture; }
    void setNormalMap(Texture *pTexture)   { m_pNormalMap = pTexture; }
    
    
    // ===========
    // + Getters +
    // ===========
    const Vector3& getPhongDiffuse() const { return m_phongAttribs.diffuse; }
    
    bool hasDiffuseMap()  const { return m_pDiffuseMap != NULL; }
    bool hasSpecularMap() const { return m_pSpecularMap != NULL; }
    bool hasNormalMap()   const { return m_pNormalMap != NULL; }
    
    Texture* getDiffuseMap()  const { return m_pDiffuseMap; }
    Texture* getSpecularMap() const { return m_pSpecularMap; }
    Texture* getNormalMap()   const { return m_pNormalMap; }
};

} // aer

#endif // AER_MATERIAL_HPP_
